package Count;

import org.w3c.dom.Node;

public class Nmain {
    public static void main(String[] args){
        CopyLink c=new CopyLink();
        CopyLink.Node node1=new CopyLink.Node(1);
        CopyLink.Node node2=new CopyLink.Node(2);
        CopyLink.Node node3=new CopyLink.Node(3);
        CopyLink.Node node4=new CopyLink.Node(4);
        CopyLink.Node node5=new CopyLink.Node(5);
        CopyLink.Node node6=new CopyLink.Node(6);
        node1.next=node2;
        node2.next=node3;
        node3.next=node4;
        node4.next=node5;
        node5.next=node6;
        node1.random=node5;
        node2.random=node4;
        node3.random=node3;
        node4.random=node2;
        node5.random=node1;
        node6.random = node6;
       CopyLink.Node head= c.copyLink(node1);
        c.display(head);

    }
}
